package com.guochenglang.www.dao;

import com.guochenglang.www.pojo.CollectBase;

import java.sql.SQLException;
import java.util.ArrayList;

/**
 * @author GuoChenglang
 */
public interface CollectBaseDao {
    /**
     * 收藏的知识库
     *
     * @param collectBase 搜索条件
     * @return 收藏知识库列表
     * @throws SQLException           sql异常
     * @throws InterruptedException   断点异常
     * @throws IllegalAccessException 非法访问异常
     * @throws InstantiationException 实现异常
     */
    ArrayList<CollectBase> collectBaseSelect(CollectBase collectBase) throws SQLException, InterruptedException, IllegalAccessException, InstantiationException;

    /**
     * 收藏的知识库，分页
     *
     * @param page       当前页面
     * @param num        每页显示个数
     * @param conditions 搜索条件
     * @param order      排列依据
     * @param mode       升序还是降序
     * @return 知识库表
     * @throws SQLException           sql异常
     * @throws InterruptedException   断点异常
     * @throws IllegalAccessException 非法访问异常
     * @throws InstantiationException 实现异常
     */
    ArrayList<CollectBase> collectBaseSelectByLimit(int page, int num, CollectBase conditions, String order, String mode) throws SQLException, InterruptedException, IllegalAccessException, InstantiationException;

    /**
     * 添加收藏
     *
     * @param collectBase 知识库的id信息
     * @return 收藏知识库的主键
     * @throws SQLException           sql异常
     * @throws InterruptedException   断点异常
     * @throws IllegalAccessException 非法访问异常
     * @throws InstantiationException 实现异常
     */
    int insertCollectBase(CollectBase collectBase) throws SQLException, InterruptedException, IllegalAccessException, InstantiationException;

    /**
     * 取消收藏
     *
     * @param collectBase 取消的条件
     * @return 取消的行数
     * @throws SQLException           sql异常
     * @throws InterruptedException   断点异常
     * @throws IllegalAccessException 非法访问异常
     * @throws InstantiationException 实现异常
     */
    int deleteCollectBase(CollectBase collectBase) throws SQLException, InterruptedException, IllegalAccessException, InstantiationException;
}
